// 手机号验证规则
export const phoneRules = [
  { required: true, message: '请输入手机号' },
  { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号' }
]

// 验证码验证规则
export const codeRules = [
  { required: true, message: '请输入验证码' },
  { pattern: /^\d{6}$/, message: '验证码为6位数字' }
]

// 密码验证规则
export const passwordRules = [
  { required: true, message: '请输入密码' },
  // { min: 8, max: 20, message: '密码长度为8-20个字符' },
  // { 
  //   validator: (val: string) => /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&]{8,}$/.test(val), 
  //   message: '密码必须包含字母和数字' 
  // }
]

// 邮箱验证规则
export const emailRules = [
  { required: true, message: '请输入邮箱' },
  { pattern: /^.+@.+\..+$/, message: '请输入正确的邮箱格式' }
]



